package net.quanter.demo.junit5.mybatis.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.quanter.demo.junit5.mybatis.dao.entity.User;
import org.apache.ibatis.annotations.Param;

/***
 *
 * 2020-06-05
 * @author harley-dog
 *
 */
public interface UserMapper extends BaseMapper<User> {

    /**
     * 测试自定义sql
     *
     * @param username 用户名
     * @return
     */
    int countByUserName(@Param("username") String username);

    /**
     * 测试分页查询
     * @param page 分页对象
     * @param age query > age
     * @return
     */
    IPage<User> selectByPage(Page<User> page, @Param("age") Integer age);
}
